WPS 基础接口 > 表格 API 参考 > ErrorCheckingOptions > ErrorCheckingOptions 对象

代表应用程序的错误检查选项。

说明

使用 Application 对象的 ErrorCheckingOptions 属性可返回 ErrorCheckingOptions 对象。

引用 Errors 对象的 Item 属性可查看与错误检查选项关联的索引值列表。

返回 ErrorCheckingOptions 对象后,可使用以下属性设置或返回错误检查选项。这些属性都是 ErrorCheckingOptions 对象的成员。

示例

下例使用 TextDate 属性启用对两位数年份文本日期的错误检查,并通知用户。

示例代码
function CheckTextDates() {

    let rngFormula = Application.Range("A1")

    Range("A1").Formula = "'April 23, 00"
    Application.ErrorCheckingOptions.TextDate = true

    //Perform check to see if 2 digit year TextDate check is on.
    if(rngFormula.Errors.Item(xlTextDate).Value == true) {
        MsgBox("The text date error checking feature is enabled.")
    }
    else {
        MsgBox("The text date error checking feature is not on.")
    }

}


请参阅